#ifndef _GUI_MAP_INTERFACE_H
#define _GUI_MAP_INTERFACE_H

#include <SFGUI/SFGUI.hpp>
#include <SFML/Graphics.hpp>

#include "gui/gui_object.h"
#include "gui/gui-tool.hpp"

class City;
class Camera;
class Tile;

class GuiMapInterface : public GuiObject
{
    public:
    GuiMapInterface(Camera* camera, City* city, sf::RenderWindow* window);

    void update(double dt);

    void useTool(sf::Vector2i tileCoord);

    enum ToolType
    {
        TOOL_NONE = 0,
        TOOL_HOUSE,
        TOOL_BUSINESS,
        TOOL_INDUSTRY,
        TOOL_ROAD,
        TOOL_POWER,
        TOOL_BULLDOZER
    };

    void setTool(const GuiTool& tool);

    void onLeftClick();
    void onLeftRelease();
    void onRightClick(sf::Event event){;}
    void onRightRelease(sf::Event event){;}
    void onMiddleClick(sf::Event event){;}
    void onEnter(sf::Event event){;}
    void onLeave(sf::Event event){;}
    void onWheel(sf::Event event){;}
    void onMove(sf::Event event){;}

    sf::Vector2i getMouseTileCoords();

    sfg::Canvas::Ptr toSfgui(){return myCanvas;}

    private:
    sfg::Canvas::Ptr    myCanvas;
    sf::RenderWindow*   mainWindow;

    City* city;
    Camera* camera;

    const GuiTool* tool;

    sf::Vector2i clickCoord;
    Tile* lastHighlighted;

};

#endif // _GUI_MAP_INTERFACE_H
